import java.util.*;
import java.io.*;
import java.net.*;

public class IndexRecord  implements Serializable {

    private String _date                 = null;
    private String _time                 = null;
    private String _exchange             = null;

    private int _totalStock            =0;
    private int _totalStockUp          =0;
    private int _totalStockDown        =0;
    private int _totalStockUnchange    =0;

    private int _newHigh               =0;
    private int _newLow                =0;

    private String   _totalVolume          = null;
    private String   _totalVolumeUp        = null;
    private String   _totalVolumeDown      = null;
    private String   _totalVolumeUnchange  = null;

    public IndexRecord() 
    {
	this( "", "", "", 0, 0, 0, 0, 0, 0, "", "", "", "");
    }
					
    public IndexRecord ( String date, String time, String exchange,
			 int total_stock, int total_stock_up, int total_stock_down,
			 int total_stock_unchange, int new_high, int new_low, 
			 String total_volume, 
			 String total_volume_up,
			 String total_volume_down, 
			 String total_volume_unchange)

    {
	setDate                  (date);
	setTime                  (time);
	setExchange              (exchange);

	setTotalStock            (total_stock);
	setTotalStockUp          (total_stock_up);
	setTotalStockDown        (total_stock_down);
	setTotalStockUnchange    (total_stock_unchange);

	setNewHigh               (new_high);
	setNewLow                (new_low);

	setTotalVolume           (total_volume);
	setTotalVolumeUp         (total_volume_up);
	setTotalVolumeDown       (total_volume_down);
	setTotalVolumeUnchange   (total_volume_unchange);
    }

    public void setDate      (String date)    { _date      = date;    }
    public void setTime      (String time)    { _time      = time;    }
    public void	setExchange  (String ex  )    { _exchange   = ex;     }

    public void	setTotalStock         (int total)           { _totalStock          = total;          }
    public void	setTotalStockUp       (int total_up)        { _totalStockUp        = total_up;       }
    public void	setTotalStockDown     (int total_down)      { _totalStockDown      = total_down;     }
    public void	setTotalStockUnchange (int total_unchange)  { _totalStockUnchange  = total_unchange; }

    public void	setNewHigh     (int new_high)      { _newHigh      = new_high;     }
    public void	setNewLow      (int new_low )      { _newLow       = new_low;      }

    public void	setTotalVolume        (String total_v)          { _totalVolume          = total_v;          }
    public void	setTotalVolumeUp      (String total_v_up)       { _totalVolumeUp        = total_v_up;       }
    public void	setTotalVolumeDown    (String total_v_down)     { _totalVolumeDown      = total_v_down;     }  
    public void	setTotalVolumeUnchange(String total_v_unchange) { _totalVolumeUnchange  = total_v_unchange; }

    public String getDate      () { return (_date       );    }
    public String getTime      () { return (_time       );    }
    public String getExchange   () { return (_exchange    );    }

    public int  getTotalStock          () { return (_totalStock          );    }
    public int  getTotalStockUp        () { return (_totalStockUp        );    }
    public int  getTotalStockDown      () { return (_totalStockDown      );    }
    public int  getTotalStockUnchange  () { return (_totalStockUnchange  );    }

    public int  getNewHigh      () { return (_newHigh      );    }
    public int  getNewLow       () { return (_newLow       );    }

    public String getTotalVolume              () { return (_totalVolume          );    }
    public String getTotalVolumeUp            () { return (_totalVolumeUp        );    }
    public String getTotalVolumeDown          () { return (_totalVolumeDown      );    }
    public String getTotalVolumeUnchange      () { return (_totalVolumeUnchange  );    }

    public void setIndexRecord(Vector record_v) {

	Enumeration enum = record_v.elements();
	while (enum.hasMoreElements()) {
	    this.setDate((String)enum.nextElement());
	    this.setTime((String)enum.nextElement());
	    this.setExchange((String)enum.nextElement());

	    this.setTotalStockUp       (Integer.parseInt(enum.nextElement().toString()));
	    this.setTotalStockDown     (Integer.parseInt(enum.nextElement().toString()));
	    this.setTotalStockUnchange (Integer.parseInt(enum.nextElement().toString()));
	    this.setTotalStock         (Integer.parseInt(enum.nextElement().toString()));

	    this.setNewHigh            (Integer.parseInt(enum.nextElement().toString()));
	    this.setNewLow             (Integer.parseInt(enum.nextElement().toString()));
	    
	    this.setTotalVolumeUp      ((String)enum.nextElement());
	    this.setTotalVolumeDown    ((String)enum.nextElement());
	    this.setTotalVolumeUnchange((String)enum.nextElement());
	    this.setTotalVolume        ((String)enum.nextElement());

	    break;
	}
    }

    public IndexRecord  getIndexRecord() {
	return this;
    }
}






